<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>函数</title>
</head>

<body>
    <button onclick="myFunction()">点我</button>
    <p>当按钮点击后，一个函数将被执行，该函数结果警告一条信息。</p>
    <script>
        function myFunction() {
            alert("你好，世界!");
        }
    </script>
</body>

</html>